
(require (lib "mred.ss" "mred"))
(require (lib "framework.ss" "framework"))
(require (lib "class.ss"))

(define f (instantiate frame% ("Simple Edit" #f 800 400)))

;; tp : theorizer panel - holds the vertically arranged item panels
;; children are draggable
(define tp (instantiate panel:horizontal-dragable%  (f)))

;; items-pane% : 
(define items-panel%
  (class vertical-panel%
    (init-field parent) ; get as object creation
    ;(init (border 3))
    ;(init (alignment '(left top)))
    (super-new [parent parent]
               (style '(border))
               (alignment '(left top))) ; pass it onto the parent class definition
    
    (let* ([p (new vertical-panel% [parent this]
                   )] ; stack vertical
           [buttons-p  ; first buttons
            (new horizontal-panel% [parent p] [stretchable-height #f] )]
           [search-p ; then search
            (new horizontal-panel% [parent p] [stretchable-height #f])] 
           )
      ;; search 
      (new text-field% 
           [label "filer"]
           [parent search-p] [callback void])
      (new button%
           [label "go"]
           [parent search-p] [callback void])
      ;; buttons
      (new button%  ; provides new-item collapse and kill
           [label "new"]
           [parent buttons-p] [callback void])
      (new button%
           [label "collapse"]
           [parent buttons-p] [callback void])
      (new button%
           [label "kill"]
           [parent buttons-p] [callback void])
      
      (instantiate editor-canvas% (p))
      
      )))



(define c1 (instantiate items-panel% (tp)))
(define c2 (instantiate items-panel% (tp)))

(define c3 (instantiate items-panel% (tp)))

(define t (instantiate text% ()))
;(send c1 set-editor t)
(send f show #t)